package com.zzh.takeoutapp.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.zzh.takeoutapp.R;
import com.zzh.takeoutapp.app.MainApp;

import java.util.List;

/**
 * @author zzh
 * @Name:
 * @Description:
 * @date
 * @time
 * @copyright
 */
public class OrderFragmentAdapter extends FragmentStatePagerAdapter {

    private List<Fragment> fragmentList;
    private List<String> titleString;

    public OrderFragmentAdapter(FragmentManager fragmentManager, List<Fragment> list,  List<String> title) {
        super(fragmentManager);
        this.fragmentList = list;
        titleString = title;
    }

    @Override
    public android.support.v4.app.Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titleString.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }
}